use crate::dao;
use crate::models::models::components::v2ray::subscription::ComponentV2raySubscription;
use crate::runtime::response::MagicBoxResponse;
use crate::runtime::result::MagicBoxResult;

#[tauri::command(rename_all = "snake_case")]
pub(crate) async fn invoke_component_v2ray_remove_subscription(subscription: ComponentV2raySubscription) -> MagicBoxResult<MagicBoxResponse<()>> {
    dao::components::v2ray::subscription::remove_subscription_config(subscription.uuid.clone())?;

    Ok(MagicBoxResponse::new_empty_success())
}